#ifndef DIALOGOPC_H
#define DIALOGOPC_H

#include <QDialog>
#include <QComboBox>
#include "Opc/CustomOpc.h"

#define COMBO_CONT IQT
//#define DEBUG

enum SELECTED_ITENS {
    IKP   = 0,
    IKI   = 1,
    IKD   = 2,
    ISP   = 3,
    ITK1   = 4,
    ITK2   = 5,
    ITIME = 6,
    IMV = 7,
    IQT = 8
};



namespace Ui {
    class DialogOpc;
}

class DialogOpc : public QDialog {
    Q_OBJECT
public:
    ~DialogOpc();
    static DialogOpc *getInstace();

    double lerItem(SELECTED_ITENS item);
    bool escreverItem(SELECTED_ITENS item, std::string valor);

    static bool connected;
    static bool memSet;


private:
    Ui::DialogOpc *ui;

    CustomOpc *opcObj;
    GrupoOpc *gOpc;
    void setConnected(bool connected_);


    DialogOpc(QWidget *parent = 0);
    static DialogOpc *instance;

    static QComboBox * vecCombo[COMBO_CONT];
    std::string itensToRead[IQT];

public slots:
    void show();
    void connectDisconnectSlot();
    void setMemSlot();

signals:
    void getParamsControl();
};

#endif // DIALOGOPC_H
